<?php

namespace partner\functions\wechat\lib;


use partner\functions\wechat\lib\BaseWechatPartner;
use Exception;

class SettlementInfo extends BaseWechatPartner
{
    protected $desensitization_properties = [
        'contact_name',
        'contact_id_number',
        'ubo_id_doc_address',
        'openid',
        'mobile_phone',
        'contact_email'
    ];

    protected $upload_properties = [
        'qualifications' => 5,
        'activities_additions' => 5
    ];

    // 入驻结算规则ID
    public $settlement_id = '';

    // 所属行业
    public $qualification_type = '';

    // 特殊资质图片
    public $qualifications = [];

    // 优惠费率活动ID
    public $activities_id = '';

    // 优惠费率活动值
    public $activities_rate = '';

    // 优惠费率活动补充材料
    public $activities_additions = [];

    public function setSettlementId(string $settlement_id = '')
    {
        if (empty($settlement_id))
            throw new Exception("入驻结算规则ID不能为空");

        $this->settlement_id = $settlement_id;
        return $this;
    }

    public function setQualificationType(string $qualification_type = '')
    {
        if (empty($qualification_type))
            throw new Exception("所属行业不能为空");

        $this->qualification_type = $qualification_type;  
        return $this;      
    }

    public function setQualifications(array $qualifications = [])
    {
        $this->qualifications = $qualifications;   
        return $this;     
    }

    public function setActivitiesId(string $activities_id = '')
    {
        $this->activities_id = $activities_id;    
        return $this;    
    }

    public function setActivitiesRate(string $activities_rate = '')
    {
        $this->activities_rate = $activities_rate;   
        return $this;     
    }

    public function setActivitiesAdditions(array $activities_additions = [])
    {
        $this->activities_additions = $activities_additions;  
        return $this;      
    }

}